package com.dropdb.demo.controller.admin;

import com.dropdb.demo.bean.bo.BaseData;
import com.dropdb.demo.bean.vo.BaseRespVO;
import com.dropdb.demo.service.CollectService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author:tanxin Desc:
 * @date:2020/6/26 20:34
 */
@RestController
@RequestMapping("/admin/collect")
public class AdminCollectController {

    @Resource
    CollectService collectService;

    @RequestMapping("/list")
    @RequiresPermissions(value = {"*", "admin:collect:list"}, logical = Logical.OR)
    public BaseRespVO queryCollect(Integer page,Integer limit,String sort,String order,Integer userId,Integer valueId){
        BaseData baseData = collectService.queryCollection(page, limit, sort, order, userId, valueId);
        return BaseRespVO.ok(baseData);
    }
}
